

from cfcall.cfgseg import cfgsegbase

from cfcall.utils import aptutils
from cfcall.etcdb import md5db

class cfgIbusDB(cfgsegbase.cfgSeg):
    
    db = "/usr/share/ibus-pinyin/db/android.db"
    file = "android.db"

    def info(self):
        print "--------------------"
        print "Ibus Dict DB"

    def check(self):
        
        # find pkg name we want to check
        print "check file md5"
        pkg =  aptutils.find_pkg_by_file(self.db)
        
        md5_sys = md5db.get_cached_md5(pkg, self.db)

        md5 = aptutils.calc_md5(self.db)
        
        print md5, "====",  md5_sys
        
        return False
    
    def save(self):
        return True
